<?php
namespace Plugin\Attractions\Commerce\Schema\Commerce_settlement;

use Plugin\Attractions\Commerce\Model\Commerce_settlement\CommerceSettlement;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 商户结算
 */
#[Schema(title: 'CommerceSettlementSchema')]
class CommerceSettlementSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '结算单号', type: 'bigint')]
    public string $id;

    #[Property(property: 'merchant_id', title: '商户ID', type: 'bigint')]
    public string $merchant_id;

    #[Property(property: 'order_count', title: '订单数量', type: 'int')]
    public string $order_count;

    #[Property(property: 'total_revenue', title: '销售额', type: 'decimal')]
    public string $total_revenue;

    #[Property(property: 'settlement_amount', title: '应结算金额', type: 'decimal')]
    public string $settlement_amount;

    #[Property(property: 'paid_amount', title: '已结算金额', type: 'decimal')]
    public string $paid_amount;

    #[Property(property: 'settlement_status', title: '结算状态：1-待结算，2-已结算', type: 'tinyint')]
    public string $settlement_status;

    #[Property(property: 'settlement_date', title: '结算日期', type: 'date')]
    public string $settlement_date;

    #[Property(property: 'payment_method', title: '付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式', type: 'tinyint')]
    public string $payment_method;

    #[Property(property: 'remark', title: '备注', type: 'text')]
    public string $remark;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;




    public function __construct(CommerceSettlement $model)
    {
       $this->id = $model->id;
       $this->merchant_id = $model->merchant_id;
       $this->order_count = $model->order_count;
       $this->total_revenue = $model->total_revenue;
       $this->settlement_amount = $model->settlement_amount;
       $this->paid_amount = $model->paid_amount;
       $this->settlement_status = $model->settlement_status;
       $this->settlement_date = $model->settlement_date;
       $this->payment_method = $model->payment_method;
       $this->remark = $model->remark;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'merchant_id' => $this->merchant_id ,'order_count' => $this->order_count ,'total_revenue' => $this->total_revenue ,'settlement_amount' => $this->settlement_amount ,'paid_amount' => $this->paid_amount ,'settlement_status' => $this->settlement_status ,'settlement_date' => $this->settlement_date ,'payment_method' => $this->payment_method ,'remark' => $this->remark ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at];
    }
}